<include file="Public:header"/>
<body data-tuktuk="boxes">
<include file="Public:left"/>

<include file="Public:aside"/>


    <section>
        <include file="Public:nav" />
        <hr />
        <article class="padding scroll">
            <div class="margin-bottom">
                <h4 class="text book inline">导航管理</h4>      
                <div class="on-right">

                <a href="{:U('Admin/Info/import')}" class="button small theme" >内容导入</a>
                    
                <a href="{:U('Admin/Nav/add')}" class="button theme small icon plus" >新增导航</a>

                <a href="{:U('Admin/Nav/design')}" class="button small icon list" >导航设计</a>
                </div>
            </div>            
            <hr />

            <table >
                <tbody>
                    <volist name="navs" id="nav">
                    <tr >
                        <td>
                        {$nav.icon}
                        <a href="#" data-name="name" class="editable" data-type="text" data-pk="{$nav.id}">{$nav.name}</a>
                        </td>
                        <td>
                            <if condition="$nav[module] eq 'url' ">
                            <a target="_blank" class="color theme" href="{$nav.url}">{$nav.module_text}</a>
                            <else />
                            {$nav.module_text}
                            </if>
                        </td>
                        <td>排序:<a data-name="idx" href="#" class="editable" data-type="text" data-pk="{$nav.id}">{$nav.idx}</a></td>
                        <td width="150">
                        <a href="{:U("Admin/Nav/edit?id=$nav[id]")}" class="button small theme" >编辑</a>
                        <a delete href="{:U("Admin/Nav/delete?id=$nav[id]")}" class="button small" >删除</a></td>
                    </tr>
                    </volist>
                </tbody>
            </table>
        </article>

        <footer class="bck dark text center">
            Powered by <a href="http://www.weiduniang.com" class="color theme text bold">Weiduniang</a>
        </footer>
    </section>
    
</body>
<load href="__PUBLIC__/js/app.js" />
<load href="__PUBLIC__/jquery-editable/css/jquery-editable.css" />
<load href="__PUBLIC__/jquery-editable/js/jquery.poshytip.js" />
<load href="__PUBLIC__/jquery-editable/js/jquery-editable-poshytip.min.js" />


<script type="text/javascript">
$(function(){
    $('.editable').editable({
        url: '{:U('Admin/Nav/updateField')}',
    });
    $('body').on('click','[delete]',function(e){
        e.preventDefault();
        TukTuk.Modal.loading();
        var obj = $(this);
        var url = $(this).attr('href');
        $.get(url,{},function(req){
            obj.parent().parent().hide('slow',function(){
                obj.parent().parent().remove();
                TukTuk.Modal.hide();
            });
        })
    })
})    
</script>
</html>
